算术移位
外观
(重定向自算術移位)
![](http://upload.wikimedia.org/wikipedia/commons/thumb/3/37/Rotate_right_arithmetically.svg/300px-Rotate_right_arithmetically.svg.png)
![](http://upload.wikimedia.org/wikipedia/commons/thumb/5/5c/Rotate_left_logically.svg/300px-Rotate_left_logically.svg.png)
在程序设计中,算术移位是一种位操作,有时被称为有符号移位。它分為算术左移和算术右移。对于二进制数来说,算术移位可以移动每個數字的位置,即每個數字都能被移动,而空出的位置又被其他數字填充。当向右移动时,最左边的位置依舊保留原有位置的數值[1]。
参考文献[编辑]
- ^ Thomas R. Cain and Alan T. Sherman. "How to break Gifford's cipher". Section 8.1: "Sticky versus Non-Sticky Bit-shifting". Cryptologia. 1997.